# 作者:何恺
# 2025年02月20日16时57分01秒
# 2557170485@qq.com
def use_except():
    """
    练习简单的异常捕获，捕获异常的格式 try except

    """
    try:
        num = int(input('请输入数字'))
    except:
        print('输入数字啊')

def use_tryexcept():
    try:
        num = int(input('输入'))
        result = 8 / num
        print(result)
    except ValueError:
        print('输入整数')
    except ZeroDivisionError:
        print('不可以输入0')
    except Exception as result:
        print(result)


def use_else_finally():
    try:
        num = int(input('输入'))
        result = 8 / num
        print(result)
    except ValueError:
        print('输入整数')
    except ZeroDivisionError:
        print('不可以输入0')
    except Exception as result:
        print(result)
    else:
        print('正常运行')
    finally:
        print('执行完成')


# use_except()
#use_tryexcept()
use_else_finally()





